package com.ruoyi.cderp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cderp.mapper.TblStockAdjustReasonMapper;
import com.ruoyi.cderp.domain.TblStockAdjustReason;
import com.ruoyi.cderp.service.ITblStockAdjustReasonService;

/**
 * 库存调整原因Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-03
 */
@Service
public class TblStockAdjustReasonServiceImpl implements ITblStockAdjustReasonService 
{
    @Autowired
    private TblStockAdjustReasonMapper tblStockAdjustReasonMapper;

    /**
     * 查询库存调整原因
     * 
     * @param id 库存调整原因主键
     * @return 库存调整原因
     */
    @Override
    public TblStockAdjustReason selectTblStockAdjustReasonById(String id)
    {
        return tblStockAdjustReasonMapper.selectTblStockAdjustReasonById(id);
    }

    /**
     * 查询库存调整原因列表
     * 
     * @param tblStockAdjustReason 库存调整原因
     * @return 库存调整原因
     */
    @Override
    public List<TblStockAdjustReason> selectTblStockAdjustReasonList(TblStockAdjustReason tblStockAdjustReason)
    {
        return tblStockAdjustReasonMapper.selectTblStockAdjustReasonList(tblStockAdjustReason);
    }

    /**
     * 新增库存调整原因
     * 
     * @param tblStockAdjustReason 库存调整原因
     * @return 结果
     */
    @Override
    public int insertTblStockAdjustReason(TblStockAdjustReason tblStockAdjustReason)
    {
        tblStockAdjustReason.setCreateTime(DateUtils.getNowDate());
        return tblStockAdjustReasonMapper.insertTblStockAdjustReason(tblStockAdjustReason);
    }

    /**
     * 修改库存调整原因
     * 
     * @param tblStockAdjustReason 库存调整原因
     * @return 结果
     */
    @Override
    public int updateTblStockAdjustReason(TblStockAdjustReason tblStockAdjustReason)
    {
        tblStockAdjustReason.setUpdateTime(DateUtils.getNowDate());
        return tblStockAdjustReasonMapper.updateTblStockAdjustReason(tblStockAdjustReason);
    }

    /**
     * 批量删除库存调整原因
     * 
     * @param ids 需要删除的库存调整原因主键
     * @return 结果
     */
    @Override
    public int deleteTblStockAdjustReasonByIds(String[] ids)
    {
        return tblStockAdjustReasonMapper.deleteTblStockAdjustReasonByIds(ids);
    }

    /**
     * 删除库存调整原因信息
     * 
     * @param id 库存调整原因主键
     * @return 结果
     */
    @Override
    public int deleteTblStockAdjustReasonById(String id)
    {
        return tblStockAdjustReasonMapper.deleteTblStockAdjustReasonById(id);
    }
}
